<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ContentCategoryRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title'=>'required',
            'home_template'=>'required',
            'list_template'=>'required',
            'content_template' => 'required',
        ];
    }

    //修改laravel默认的提示消息
    public  function  messages()
    {
        return [
            'title.required'=>'栏目名称不能为空',
            'home_template.required'=>'封面模板不能为空',
            'list_template.required'=>'列表模板不能为空',
            'content_template.required'=>'内容模板不能为空',
        ];
    }
}
